package com.axjy.service.impl;

import com.axjy.dao.JiHuaMapper;
import com.axjy.pojo.JiHua;
import com.axjy.service.JiHuaService;
import com.axjy.util.Pager;
import com.axjy.web.dto.RoleMgnDto;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by dell on 2018/1/25.
 */
@Service("jiHuaService")
public class JiHuaServiceImpl implements JiHuaService {

    @Resource
    private JiHuaMapper jiHuaMapper;


    @Override
    public List<JiHua> search2(String jhName) {
        return jiHuaMapper.search2(jhName);
    }

    @Override
    public Pager searchPager(Integer offset, Integer limit, RoleMgnDto dto) {
        Pager pager=new Pager();
        pager.setTotal(jiHuaMapper.searchTotal(dto));
        pager.setRows(jiHuaMapper.searchRows(offset,limit,dto));
        return pager;
    }

    @Override
    public void add2(JiHua jiHua) {
        jiHuaMapper.add2(jiHua);
    }

    @Override
    public void update2(JiHua jiHua) {
        jiHuaMapper.update2(jiHua);
    }

    @Override
    public void delete2(Integer cjh_id) {
        jiHuaMapper.delete2(cjh_id);
    }
}
